/**
 * @description 定义common模块，进行导出
 */

const state = {
  token: '123',
  userInfo: {}
}
const getters = {
  getToken (_state) {
    return _state.token
  }
}
const actions = {
  tokenAct (_state, _date) {
    Promise.resolve().then(() => {
      _state.commit('setToken', '异步后的数据' + _date)
    })
  }
}
const mutations = {
  // 缓存token
  setToken (_state, _token) {
    _state.token = _token
  }
}
export default {
  // 开启命名空间
  namespaced: true,
  // 四大核心配置
  state,
  getters,
  actions,
  mutations
}
